<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib prefix="huoyun" uri="/huoyun"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>常跑路线</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/theme/css/main.css">
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/theme/css/style_userCenter.css">
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/theme/css/dialog.css">
	<style type="text/css">
		#normally_transport_route_table_div table {
			width: 100%;
			border-collapse: collapse;
			border-bottom: 1px solid #666;
		}
		
		#normally_transport_route_table_div table th{
			color: #333;
			padding: 3px;
			font-family: monospace;
			background: #9cf;
			text-align: left;
			border-top: 1px solid #666;
			border-bottom: 1px solid #666;
			text-align: center;
		}
		
		#normally_transport_route_table_div table td {
			padding: 3px;
			border-top: 1px solid #ccc;
			text-align: center;
		}
		
		#normally_transport_route_table_div table tr:hover, tr.hover {
			background: #cdf;
		}
		
		#submit_button {
			width: 100px;
			height: 40px;
			background-image:
				url("${pageContext.request.contextPath}/theme/images/button_normal.png");
			background-size: 100% 100%;
			border: none;
			cursor: pointer;
			font-family: 宋体;
			font-size: 18px;
			font-style: normal;
			color: #fff;
			font-weight: bold;
			background-image:
				url("${pageContext.request.contextPath}/theme/images/button_normal_ie.png")
				\9;
		}
		
		#submit_button:hover,#submit_button.hover {
			background-image:
				url("${pageContext.request.contextPath}/theme/images/button_hover.png");
			background-image:
				url("${pageContext.request.contextPath}/theme/images/button_hover_ie.png")
				\9;
		}
		
		#submit_button:active,#submit_button.active {
			background-image:
				url("${pageContext.request.contextPath}/theme/images/button_down.png");
			background-image:
				url("${pageContext.request.contextPath}/theme/images/button_down_ie.png")
				\9;
		}
	</style>
	
	<script type="text/javascript" src="${pageContext.request.contextPath}/theme/js/calendar/WdatePicker.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/theme/js/jquery-1.6.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/theme/js/jquery.validate.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/theme/js/additional-methods.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/theme/js/jquery.form.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/theme/js/dialog.js"></script>

  </head>
  
  <body>
    <div>
		<jsp:include page="../userAdmin/nav.jsp">
			<jsp:param value="nav_main" name="nav" />
		</jsp:include>
	</div>
	<div class="realCer">
		<!--主体部分-->
		<div class="realMain clearfix mt10">
			<!--左侧菜单-->
			<div class="realLeft" id="meunLeft">
				<jsp:include page="../userAdmin/leftMenu.jsp">
					<jsp:param value="con_nav_main" name="con_nav" />
					<jsp:param value="normallyTransportRoutes" name="selectMenu"/>
				</jsp:include>
			</div>
			<!--中间-->
			<div class="realRight ml10">
				<!--中间-->
				<div class="realR_left">
					<div class="box" style="width:805px;">
						<div class="tit">
							<strong>设置常跑路线</strong>
						</div>
						<div class="con">
							<!-- 常跑路线列表开始 -->
							<div id="normally_transport_route_table_div" class="form_wrap clearfix">
								<s:if test="normallyTransportRouteModelList != null && normallyTransportRouteModelList.size() > 0">
									<form id="normally_transport_route_table_form" method="post">
										<p>
											<font size="4" color="black"><strong>已添加的常跑路线：</strong></font>
										</p>
										<table id="normally_transport_route_table">
											<tr style="background-color: silver;">
												<th>序号</th>
												<th>车牌号</th>
												<th>常跑路线</th>
												<th>操作</th>
											</tr>
											<s:iterator value="normallyTransportRouteModelList" id="model" status="st">
												<tr>
													<td><s:property value="#st.index+1"/></td>
													<td>
														<s:property value="#model.car.cardNumber" />
													</td>
													<%-- <td style="text-align:left; display: none;">
														<huoyun:regionSelect provinceName="model.normallyTransportRoute.startProvince" cityName="model.normallyTransportRoute.startProvince" townName="modl.normallyTransportRoute.startTown" provinceValue="${model.normallyTransportRoute.startProvince }" cityValue="${model.normallyTransportRoute.startCity }" townValue="${model.normallyTransportRoute.startTown }" />
														<br>
														到
														<br>
														<huoyun:regionSelect provinceName="model.normallyTransportRoute.endProvince" cityName="model.normallyTransportRoute.endProvince" townName="modl.normallyTransportRoute.endTown" provinceValue="${model.normallyTransportRoute.endProvince }" cityValue="${model.normallyTransportRoute.endCity }" townValue="${model.normallyTransportRoute.endTown }" />
													</td> --%>
													<td>
														<huoyun:regionSelect provinceValue="${model.normallyTransportRoute.startProvince }" cityValue="${model.normallyTransportRoute.startCity }" townValue="${model.normallyTransportRoute.startTown }" type="view"/>
														&rarr;
														<huoyun:regionSelect provinceValue="${model.normallyTransportRoute.endProvince }" cityValue="${model.normallyTransportRoute.endCity }" townValue="${model.normallyTransportRoute.endTown }" type="view"/>
													</td>
													<td>
														<!-- <a href="">修改</a> -->
														<a href="/huoyun/car/deleteNormalRoute.action?ntRouteId=${model.normallyTransportRoute.id }" onclick="if(confirm('确定要删除该常跑路线吗？'))return true; else return false;">删除</a>
														<%-- <script type="text/javascript">
															function editRoute(index)
															{
																$("tr").eq(index).find("td").eq(2).html("<input type='button' value='测试'>");
																//$("tr").eq(index).find("td").eq(3).css("display","none");
																//$("tr").eq(index).find("td").eq(2).css("display","");
															};
														</script> --%>
													</td>
												</tr>
											</s:iterator>
										</table>
									</form>
								</s:if>
								<s:else>
									<p>
										<strong><font size="5">您尚未添加常跑路线。</font>
										</strong>
									</p>
								</s:else>
							</div>
							<!-- 常跑路线列表结束 -->
							<br>
							<!-- 添加常跑路线开始 -->
							<div>
								<s:if test="carList != null && carList.size() > 0">
									<form action="/huoyun/car/addNormallyTransportRoute.action" id="add_normally_transport_route_form" method="post">
										<p>
											<font size="4" color="black"><strong>添加新的常跑路线：</strong></font>
										</p>
										<table>
											<!-- 车牌号 -->
											<tr>
												<td width="100" id="xx1"><span class="red">* </span>车牌号：</td>
												<td id="number_td">
													<s:select id="carDetailID" name="normallyTransportRoute.carId"
														list="carList" listKey="id" listValue="cardNumber"
														headerKey="-1" headerValue="-请选择已有车辆-" emptyOption="false"
														multiple="false" theme="simple">
													</s:select>
												</td>
											</tr>
											<tr>
												<td width="100" id="xx1"><span class="red">* </span>常跑路线：</td>
												<td>
													起始地：<huoyun:regionSelect provinceName="normallyTransportRoute.startProvince" cityName="normallyTransportRoute.startCity" townName="normallyTransportRoute.startTown" />
													<br>
													目的地：<huoyun:regionSelect provinceName="normallyTransportRoute.endProvince" cityName="normallyTransportRoute.endCity" townName="normallyTransportRoute.endTown"/>
												</td>
											</tr>
											<tr>
												<td></td>
												<td>
													<input type="submit" name="submit_button" id="submit_button" value="添&nbsp;加" class="submit_button" />
												</td>
											</tr>
										</table>
									</form>
								</s:if>
								<s:else>
									<p>
										<strong><font size="5">您尚未注册车辆。</font>
										</strong>
									</p>
								</s:else>
							</div>
							<!-- 添加常跑路线结束 -->
						</div>
					</div>
				</div>
				<!-- 中间 -->
			</div>
			<!--中由-->
		</div>
	</div>
	<div>
		<jsp:include page="../footer.jsp"></jsp:include>
	</div>
  </body>
</html>
